<?php
require(dirname(__FILE__) . '/includes/init.php');
if(empty($_REQUEST['sn'])){
	header("Location: customerservice.php\n");
}else{
	$sql = "SELECT * FROM ".$ecs->table('orders')." WHERE order_id='".$_REQUEST['sn']."'";
	$order = $db->getRow($sql);
}
if ($_REQUEST['act'] == 'do')
{
	$order_id = intval($_REQUEST['order_id']);
	if(empty($order_id)){
		header("Location: vip_orders.php\n");
	}
	$sql = "SELECT order_id,money FROM ".$ecs->table('orders')." WHERE order_id='".$order_id."'";
	$order = $db->getRow($sql);
	$order_id = $order['order_id'];
	if(empty($order_id)){
		header("Location: vip_orders.php\n");
	}else if($order['money']<500){
		header("Location: vip_orders.php\n");
	}
	else{
		$status = $_REQUEST['status'];
        $trace_name = $_REQUEST['trace_name'];
		$content = $_REQUEST['content'];
		$sql = "INSERT INTO " .$ecs->table('tracing'). "(order_id,contents,status,trace_name,trace_time)".
                "VALUES ('".$order_id."','".$content."','".$status."','".$trace_name."','".gmtime()."')";
        $db->query($sql);
        header("Location: vip_orders.php\n");
    }
}
?>
<!-- $Id: goods_info.htm 17126 2010-04-23 10:30:26Z liuhui $ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>管理中心 - 大客户跟进 </title>
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/general.css" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
</head>
<body>
 
<h1>
<span class="action-span"><a href="vip_orders.php">大客户订单列表</a></span>
<span class="action-span1"><a href="index.php?act=main">管理中心</a> </span><span id="search_id" class="action-span1"> - 大客户跟进 </span>
<div style="clear:both"></div>
</h1> 
<!-- start goods form -->
<div class="tab-div">
    <!-- tab bar -->
 
    <!-- tab body -->
    <div id="tabbody-div">
       <table>
	    <tr>
		  <td>收货人：<?php echo $order['user'];?></td>
        </tr>
		 <tr>
		  <td>手机号：<?php echo $order['mobile'];?></td>
        </tr>
		 <tr>
		  <td>产品：<?php echo $order['product_name'];?></td>
        </tr>
	  </table>
	  <form enctype="multipart/form-data" action="" method="post" name="theForm" onsubmit="return trace_yz()">
        <table width="90%" id="general-table" align="center">
          <tr>
            <td class="label">跟进状态：</td>
            <td><select name="status" id="trace_status">
			<option value="0">请选择...</option>
			<option value="1">跟进中</option>
			<option value="2">已完结</option>
			</select>
            </td>
          </tr>
		   <tr>
            <td class="label">跟进人：</td>
            <td><select name="trace_name" id="trace_name">
			<option value="0">请选择...</option>
			<option value="曾平">曾平</option>
			<option value="郑娟">郑娟</option>
			<option value="张世杰">张世杰</option>
			<option value="唐志伟">唐志伟</option>
			<option value="张文强">张文强</option>
			<option value="林云川">林云川</option>
			</select>
          </tr>
          <tr>
            <td class="label">内容：</td>
            <td><textarea name="content" cols="40" rows="3"></textarea></td>
          </tr>
		  <tr>
            <td><input type="hidden" name="order_id" value="<?php echo $_GET['sn'];?>" /></td>
          </tr>

        </table>
 
        <div class="button-div">
          <input type="submit" value=" 确定 " class="button" />
          <input type="reset" value=" 重置 " class="button" />
        </div>
        <input type="hidden" name="act" value="do" />
      </form>
    </div>
</div>
<!-- end goods form -->
</body>
</html>
